Notes 11/11: * figure out dcast issues * replacing NA/0s within pipe
Need to determine appropriate size range for comparison. Because they are not evenly distributed (i.e. larger fish in Bonaire, smaller in Barbuda), I will likely want to compare length-feeding relationships as opposed to pooled averages
Potential predictor variables are site-level fish, benthic, and rugosity values. These are likely correlated to one another, and I need to determine which ones I ultimately want to use (if modeling behavioral responses via any multivariate regressions). I can also move to SEM if I want to keep multiple correlated predictors.
First, check distribution of predictor variables of interest: not very normally distributed…
Variable selection notes: - excluding both carnivore variables as they are highly correlated with scarid biomass and total biomass, eventually I could make these more nuanced by distinguishing actual predators, but right now I don’t think it reflects actual predator populations of >15cm parrotfish - rugosity is highly correlated with turf cover, and scarid density - scarid density: removing for now, because I think it was a bit skewed from Barbuda juveniles - could eventually use consp. scarid length as another indicator of overfishing?
## Importance of components:
## PC1 PC2 PC3 PC4 PC5 PC6
## Standard deviation 1.694 1.5167 0.66913 0.50517 0.30585 0.18692
## Proportion of Variance 0.478 0.3834 0.07462 0.04253 0.01559 0.00582
## Cumulative Proportion 0.478 0.8614 0.93605 0.97859 0.99418 1.00000
Fish-level grazing behaviors (as well as competitive interaction frequency)
Variable selection notes: - for_bites is correlated with fr and for_dur, but I will play around with keeping it for now.
Note: remove G1 grazing instances here?
Notes: - scarid biomass is not the best predictor once I account for differences between my samples in terms of the sizes of fish I was sampling. I think the grazing/length relationships are much stronger.
- restraining sample size to length windows lowers sample size and makes trends much less pronounced - esp. for phase differences
- reducing sample to individual phase only also blurs trends
-site-level predictors: scar_bm,scar_den,carn_bm,benthic (pc1,pc2)
-fish-level predictors: species, phase, length
–eventually run separately for different species
–species*scar_bm interaction?
-random effects: island
-response variables: g_frac, br (?), and fr (run separately)
##
## Call:
## lm(formula = fr ~ species + phase + length_cm + scar_bm + consp_den +
## ma_canopy + ta_cover + ta_canopy, data = filter(sum_id_pca1,
## species_code != "rbp"))
##
## Residuals:
## Min 1Q Median 3Q Max
## -1280.02 -237.94 -10.27 251.03 2330.12
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2227.63533 147.43520 15.109 < 2e-16 ***
## speciesSparisoma viride -641.20859 42.86811 -14.958 < 2e-16 ***
## phaset -192.74794 49.33891 -3.907 0.000104 ***
## length_cm -7.19004 3.45000 -2.084 0.037568 *
## scar_bm -0.04198 0.02041 -2.057 0.040123 *
## consp_den 6.41533 7.05443 0.909 0.363494
## ma_canopy -9.95208 4.59664 -2.165 0.030767 *
## ta_cover -6.57645 1.42098 -4.628 4.51e-06 ***
## ta_canopy -171.73456 24.09165 -7.128 2.87e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 443.1 on 612 degrees of freedom
## Multiple R-squared: 0.4922, Adjusted R-squared: 0.4856
## F-statistic: 74.16 on 8 and 612 DF, p-value: < 2.2e-16
## species phase length_cm scar_bm consp_den ma_canopy ta_cover
## 1.442493 1.782302 1.979154 2.983668 1.867996 2.490887 1.650941
## ta_canopy
## 2.404464
Only VIF above 5 is rugosity
##
## Call:
## lm(formula = fr ~ species + phase + length_cm + pc1 + pc2, data = filter(sum_id_pca1,
## species_code != "rbp"))
##
## Residuals:
## Min 1Q Median 3Q Max
## -1459.30 -256.95 2.97 258.76 2378.46
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1267.196 91.934 13.784 < 2e-16 ***
## speciesSparisoma viride -632.357 37.811 -16.724 < 2e-16 ***
## phaset -181.674 51.114 -3.554 0.000408 ***
## length_cm -8.060 3.574 -2.255 0.024484 *
## pc1 -129.671 11.790 -10.999 < 2e-16 ***
## pc2 21.238 16.542 1.284 0.199666
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 460.3 on 615 degrees of freedom
## Multiple R-squared: 0.4494, Adjusted R-squared: 0.4449
## F-statistic: 100.4 on 5 and 615 DF, p-value: < 2.2e-16
## species phase length_cm pc1 pc2
## 1.039991 1.772730 1.968743 1.140081 1.097072
## Linear mixed-effects model fit by REML
## Data: filter(sum_id_pca1, species_code != "rbp")
## AIC BIC logLik
## 9322.943 9358.316 -4653.471
##
## Random effects:
## Formula: ~1 | island
## (Intercept) Residual
## StdDev: 442.1831 450.4068
##
## Fixed effects: fr ~ phase + length_cm + species + pc1 + pc2
## Value Std.Error DF t-value p-value
## (Intercept) 1326.6141 270.99370 613 4.895369 0.0000
## phaset -163.0290 50.24074 613 -3.244957 0.0012
## length_cm -9.1235 3.52618 613 -2.587367 0.0099
## speciesSparisoma viride -623.1907 37.04353 613 -16.823201 0.0000
## pc1 89.0698 44.32152 613 2.009628 0.0449
## pc2 8.7783 31.20623 613 0.281299 0.7786
## Correlation:
## (Intr) phaset lngth_ spcsSv pc1
## phaset 0.168
## length_cm -0.307 -0.651
## speciesSparisoma viride -0.105 -0.067 0.085
## pc1 0.037 0.050 0.021 0.008
## pc2 0.046 0.007 -0.012 0.003 0.114
##
## Standardized Within-Group Residuals:
## Min Q1 Med Q3 Max
## -2.89990834 -0.56004163 -0.01254647 0.53166747 5.13083127
##
## Number of Observations: 621
## Number of Groups: 3
##
## Family: gaussian
## Link function: identity
##
## Formula:
## fr ~ species + phase + s(length_cm) + s(scar_bm) + s(pc1) + s(pc2)
##
## Parametric coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1088.72 27.46 39.652 < 2e-16 ***
## speciesSparisoma aurofrenatum -508.69 50.10 -10.153 < 2e-16 ***
## speciesSparisoma viride -618.17 33.37 -18.526 < 2e-16 ***
## phaset -111.30 39.36 -2.828 0.00481 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Approximate significance of smooth terms:
## edf Ref.df F p-value
## s(length_cm) 1.000 1.000 16.207 6.22e-05 ***
## s(scar_bm) 1.006 1.009 2.544 0.11121
## s(pc1) 3.481 4.039 33.161 < 2e-16 ***
## s(pc2) 3.814 4.375 3.524 0.00476 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## R-sq.(adj) = 0.513 Deviance explained = 52.1%
## -REML = 5772.3 Scale est. = 1.627e+05 n = 782
To Do as of Nov. 7 * incorporate pcs * boosted regression trees ecosphere 2017 adrians paper * simpler graphs with just herb density x axis - grazing behaviors y, facet by species * speciesdensity as fixed effect~~ species as random effect *break out species and run separately~~